/*
  学习目标：类组件-React中的props传值
*/
import React, { Component } from 'react';

export default class App extends Component {
  render() {
    return (
      <div>
        {/* 1.给组件标签设置标签属性 */}
        <Child title="Hello 干饭"></Child>
      </div>
    );
  }
}

class Child extends React.Component {
  render() {
    // 👍 推荐解构props
    const { title } = this.props;
    return (
      <div>
        {/* 2.🔔 通过this.props来访问props对象 */}
        <h1>希望接收到title : {title}</h1>
      </div>
    );
  }
}
